import { defineStore } from 'pinia'

export const useAppStore = defineStore('app', {
  state: () => ({
    sidebarCollapsed: false,
    device: 'desktop', // desktop, tablet, mobile
    language: 'zh-cn',
    theme: 'light'
  }),
  
  actions: {
    toggleSidebar() {
      this.sidebarCollapsed = !this.sidebarCollapsed
    },
    
    closeSidebar() {
      this.sidebarCollapsed = true
    },
    
    openSidebar() {
      this.sidebarCollapsed = false
    },
    
    setDevice(device) {
      this.device = device
    },
    
    setLanguage(language) {
      this.language = language
    },
    
    setTheme(theme) {
      this.theme = theme
    }
  }
})
